package com.wzh.goods.web;

import com.wzh.goods.entity.GoodsEntity;
import com.wzh.goods.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author WZH
 * @title: ActController
 * @projectName miaosha
 * @description:
 * @date 2022/2/22
 */
@Controller
public class ActController {
    @Autowired
    private GoodsService goodsService;

    @RequestMapping(value = {"{id}.html"})
    public String items(@PathVariable Integer id, Model model){
        GoodsEntity byId = goodsService.getById(id);
        model.addAttribute("goods",byId);
        return "item";
    }
}
